FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 5204
EXPOSE 5205

FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY src/app/dreamwork.web.mvc.app/dreamwork.web.mvc.app.csproj dreamwork.web.mvc.app/
RUN dotnet restore dreamwork.web.mvc.app/dreamwork.web.mvc.app.csproj
COPY . .
WORKDIR /src/src/app/dreamwork.web.mvc.app
RUN dotnet build dreamwork.web.mvc.app.csproj -c Release -o /app

FROM build AS publish
RUN dotnet publish dreamwork.web.mvc.app.csproj -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "dreamwork.web.mvc.app.dll"]
